package spotGUI.personalProfileGUI;

import java.awt.Dimension;
import java.awt.Font;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.Insets;
import java.sql.Timestamp;
import java.text.DateFormat;

import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.border.EmptyBorder;

import personalProfile.PersonalDataManager;
import utils.MaxLenghtTextDocument;

import com.toedter.calendar.JDateChooser;

import elements.PersonalData;
import java.util.ResourceBundle;



public class PersonalDataPanel extends JPanel {
	
	private JLabel lblAboutMe;
	private JLabel lblBirthdate;
	private JLabel lblBirthplace;
	private JLabel lblSchool;
	private JLabel lblClass;
	private JLabel lblSection;
	private JLabel lblEmail;
	private JLabel lblCity;
	private JLabel lblRoute;
	private JLabel lblPhone;
	private JLabel lblMobilePhone;
	private JLabel lblMySport;
	private JLabel lblMyTeam;
	private JLabel lblBestSport;
	private JLabel lblBestTeam;
	private JLabel lblBestSportsman;
	private JLabel lblBestMusicalGenre;
	private JLabel lblBestSinger;
	private JLabel lblBestBook;
	private JLabel lblBestFilm;
	private JLabel lblBestActor;
	private JLabel lblBestSong;
	private JTextArea textArea;
	private JTextField textField;
	private JTextField textField_1;
	private JTextField textField_2;
	private JTextField textField_3;
	private JTextField textField_4;
	private JTextField textField_5;
	private JTextField textField_6;
	private JTextField textField_7;
	private JTextField textField_8;
	private JTextField textField_9;
	private JTextField textField_10;
	private JTextField textField_11;
	private JTextField textField_12;
	private JTextField textField_13;
	private JTextField textField_14;
	private JTextField textField_15;
	private JTextField textField_16;
	private JTextField textField_17;
	private JTextField textField_18;
	private JTextField textField_19;
	private JTextField textField_20;
	private JDateChooser dateChooser;
	private GridBagConstraints gbc_textField;

	private Font font = new Font("Dialog", Font.BOLD, 12);

	
	public void fillFields (PersonalData data) {
		textArea.setText(data.aboutMe);
		if (data.birthdate != null) {
			textField.setText(DateFormat.getDateInstance(DateFormat.LONG).format(data.birthdate));
			dateChooser.setDate(data.birthdate);
		} else {
			textField.setText(null);
		}
		textField_1.setText(data.birthplace);
		textField_2.setText(data.school);
		textField_3.setText(data.schoolClass);
		textField_4.setText(data.school);
		textField_5.setText(data.email);
		textField_6.setText(data.city);
		textField_7.setText(data.route);
		textField_19.setText(data.homePhone);
		textField_20.setText(data.mobilePhone);
		textField_8.setText(data.mySport);
		textField_9.setText(data.myTeam);
		textField_10.setText(data.bestSport);
		textField_11.setText(data.bestTeam);
		textField_12.setText(data.bestSportsman);
		textField_13.setText(data.bestMusicalGenre);
		textField_14.setText(data.bestSinger);
		textField_15.setText(data.bestSong);
		textField_16.setText(data.bestBook);
		textField_17.setText(data.bestFilm);
		textField_18.setText(data.bestActor);
	}
	
	public PersonalDataPanel(PersonalDataManager manager) {
		GridBagLayout gridBagLayout = new GridBagLayout();
		gridBagLayout.columnWidths = new int[]{0, 0, 0};
		gridBagLayout.rowHeights = new int[]{0, 0, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
		gridBagLayout.columnWeights = new double[]{0.0, 1.0, Double.MIN_VALUE};
		gridBagLayout.rowWeights = new double[]{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
		setLayout(gridBagLayout);
		
	
		
		lblAboutMe = new JLabel(ResourceBundle.getBundle("spotGUI.personalProfileGUI.messages").getString("PersonalDataPanel.lblAboutMe.text")); //$NON-NLS-1$ //$NON-NLS-2$
		lblAboutMe.setFont(font);
		GridBagConstraints gbc_lblAboutMe = new GridBagConstraints();
		gbc_lblAboutMe.anchor = GridBagConstraints.NORTHEAST;
		gbc_lblAboutMe.insets = new Insets(0, 0, 5, 5);
		gbc_lblAboutMe.gridx = 0;
		gbc_lblAboutMe.gridy = 0;
		add(lblAboutMe, gbc_lblAboutMe);
		
		textArea = new JTextArea();
		textArea.setDocument(new MaxLenghtTextDocument(1000));
		textArea.setEditable(false);
		textArea.setOpaque(false);
		textArea.setLineWrap(true);
		textArea.setWrapStyleWord(true);
		GridBagConstraints gbc_textArea = new GridBagConstraints();
		gbc_textArea.insets = new Insets(0, 0, 5, 0);
		gbc_textArea.fill = GridBagConstraints.BOTH;
		gbc_textArea.gridx = 1;
		gbc_textArea.gridy = 0;
		add(textArea, gbc_textArea);
		
		lblBirthdate = new JLabel(ResourceBundle.getBundle("spotGUI.personalProfileGUI.messages").getString("PersonalDataPanel.lblBirthdate.text")); //$NON-NLS-1$ //$NON-NLS-2$
		lblBirthdate.setFont(font);
		GridBagConstraints gbc_lblBirthdate = new GridBagConstraints();
		gbc_lblBirthdate.anchor = GridBagConstraints.SOUTHEAST;
		gbc_lblBirthdate.insets = new Insets(0, 0, 5, 5);
		gbc_lblBirthdate.gridx = 0;
		gbc_lblBirthdate.gridy = 2;
		add(lblBirthdate, gbc_lblBirthdate);
		
		dateChooser = new JDateChooser();
		dateChooser.setPreferredSize(new Dimension(130, 18));
		
		textField = new JTextField();
		textField.setEditable(false);
		textField.setBorder(new EmptyBorder(0, 0, 0, 0));
		textField.setOpaque(false);
		gbc_textField = new GridBagConstraints();
		gbc_textField.anchor = GridBagConstraints.SOUTHWEST;
		gbc_textField.insets = new Insets(0, 0, 5, 0);
		gbc_textField.gridx = 1;
		gbc_textField.gridy = 2;
		add(textField, gbc_textField);
		textField.setColumns(10);
		
		lblBirthplace = new JLabel(ResourceBundle.getBundle("spotGUI.personalProfileGUI.messages").getString("PersonalDataPanel.lblBirthplace.text")); //$NON-NLS-1$ //$NON-NLS-2$
		lblBirthplace.setFont(font);
		GridBagConstraints gbc_lblBirthplace = new GridBagConstraints();
		gbc_lblBirthplace.anchor = GridBagConstraints.NORTHEAST;
		gbc_lblBirthplace.insets = new Insets(0, 0, 5, 5);
		gbc_lblBirthplace.gridx = 0;
		gbc_lblBirthplace.gridy = 3;
		add(lblBirthplace, gbc_lblBirthplace);
		
		textField_1 = new JTextField();
		textField_1.setDocument(new MaxLenghtTextDocument(35));
		textField_1.setEditable(false);
		textField_1.setBorder(new EmptyBorder(0, 0, 0, 0));
		textField_1.setOpaque(false);
		GridBagConstraints gbc_textField_1 = new GridBagConstraints();
		gbc_textField_1.insets = new Insets(0, 0, 5, 0);
		gbc_textField_1.fill = GridBagConstraints.HORIZONTAL;
		gbc_textField_1.gridx = 1;
		gbc_textField_1.gridy = 3;
		add(textField_1, gbc_textField_1);
		textField_1.setColumns(10);
		
		lblSchool = new JLabel(ResourceBundle.getBundle("spotGUI.personalProfileGUI.messages").getString("PersonalDataPanel.lblSchool.text")); //$NON-NLS-1$ //$NON-NLS-2$
		lblSchool.setFont(font);
		GridBagConstraints gbc_lblSchool = new GridBagConstraints();
		gbc_lblSchool.anchor = GridBagConstraints.NORTHEAST;
		gbc_lblSchool.insets = new Insets(0, 0, 5, 5);
		gbc_lblSchool.gridx = 0;
		gbc_lblSchool.gridy = 5;
		add(lblSchool, gbc_lblSchool);
		
		textField_2 = new JTextField();
		textField_1.setDocument(new MaxLenghtTextDocument(35));
		textField_2.setEditable(false);
		textField_2.setBorder(new EmptyBorder(0, 0, 0, 0));
		textField_2.setOpaque(false);
		GridBagConstraints gbc_textField_2 = new GridBagConstraints();
		gbc_textField_2.insets = new Insets(0, 0, 5, 0);
		gbc_textField_2.fill = GridBagConstraints.HORIZONTAL;
		gbc_textField_2.gridx = 1;
		gbc_textField_2.gridy = 5;
		add(textField_2, gbc_textField_2);
		textField_2.setColumns(10);
		
		lblClass = new JLabel(ResourceBundle.getBundle("spotGUI.personalProfileGUI.messages").getString("PersonalDataPanel.lblClass.text")); //$NON-NLS-1$ //$NON-NLS-2$
		lblClass.setFont(font);
		GridBagConstraints gbc_lblClass = new GridBagConstraints();
		gbc_lblClass.anchor = GridBagConstraints.NORTHEAST;
		gbc_lblClass.insets = new Insets(0, 0, 5, 5);
		gbc_lblClass.gridx = 0;
		gbc_lblClass.gridy = 6;
		add(lblClass, gbc_lblClass);
		
		textField_3 = new JTextField();
		textField_3.setDocument(new MaxLenghtTextDocument(35));
		textField_3.setEditable(false);
		textField_3.setBorder(new EmptyBorder(0, 0, 0, 0));
		textField_3.setOpaque(false);
		GridBagConstraints gbc_textField_3 = new GridBagConstraints();
		gbc_textField_3.insets = new Insets(0, 0, 5, 0);
		gbc_textField_3.fill = GridBagConstraints.HORIZONTAL;
		gbc_textField_3.gridx = 1;
		gbc_textField_3.gridy = 6;
		add(textField_3, gbc_textField_3);
		textField_3.setColumns(10);
		
		lblSection = new JLabel(ResourceBundle.getBundle("spotGUI.personalProfileGUI.messages").getString("PersonalDataPanel.lblSection.text")); //$NON-NLS-1$ //$NON-NLS-2$
		lblSection.setFont(font);
		GridBagConstraints gbc_lblSection = new GridBagConstraints();
		gbc_lblSection.anchor = GridBagConstraints.NORTHEAST;
		gbc_lblSection.insets = new Insets(0, 0, 5, 5);
		gbc_lblSection.gridx = 0;
		gbc_lblSection.gridy = 7;
		add(lblSection, gbc_lblSection);
		
		textField_4 = new JTextField();
		textField_4.setDocument(new MaxLenghtTextDocument(35));
		textField_4.setEditable(false);
		textField_4.setBorder(new EmptyBorder(0, 0, 0, 0));
		textField_4.setOpaque(false);
		GridBagConstraints gbc_textField_4 = new GridBagConstraints();
		gbc_textField_4.insets = new Insets(0, 0, 5, 0);
		gbc_textField_4.fill = GridBagConstraints.HORIZONTAL;
		gbc_textField_4.gridx = 1;
		gbc_textField_4.gridy = 7;
		add(textField_4, gbc_textField_4);
		textField_4.setColumns(10);
		
		lblEmail = new JLabel(ResourceBundle.getBundle("spotGUI.personalProfileGUI.messages").getString("PersonalDataPanel.lblEmail.text")); //$NON-NLS-1$ //$NON-NLS-2$
		lblEmail.setFont(font);
		GridBagConstraints gbc_lblEmail = new GridBagConstraints();
		gbc_lblEmail.anchor = GridBagConstraints.NORTHEAST;
		gbc_lblEmail.insets = new Insets(0, 0, 5, 5);
		gbc_lblEmail.gridx = 0;
		gbc_lblEmail.gridy = 9;
		add(lblEmail, gbc_lblEmail);
		
		textField_5 = new JTextField();
		textField_5.setDocument(new MaxLenghtTextDocument(40));
		textField_5.setEditable(false);
		textField_5.setBorder(new EmptyBorder(0, 0, 0, 0));
		textField_5.setOpaque(false);
		GridBagConstraints gbc_textField_5 = new GridBagConstraints();
		gbc_textField_5.insets = new Insets(0, 0, 5, 0);
		gbc_textField_5.fill = GridBagConstraints.HORIZONTAL;
		gbc_textField_5.gridx = 1;
		gbc_textField_5.gridy = 9;
		add(textField_5, gbc_textField_5);
		textField_5.setColumns(10);
		
		lblCity = new JLabel(ResourceBundle.getBundle("spotGUI.personalProfileGUI.messages").getString("PersonalDataPanel.lblCity.text")); //$NON-NLS-1$ //$NON-NLS-2$
		lblCity.setFont(font);
		GridBagConstraints gbc_lblCity = new GridBagConstraints();
		gbc_lblCity.anchor = GridBagConstraints.NORTHEAST;
		gbc_lblCity.insets = new Insets(0, 0, 5, 5);
		gbc_lblCity.gridx = 0;
		gbc_lblCity.gridy = 11;
		add(lblCity, gbc_lblCity);
		
		textField_6 = new JTextField();
		textField_6.setDocument(new MaxLenghtTextDocument(35));
		textField_6.setEditable(false);
		textField_6.setBorder(new EmptyBorder(0, 0, 0, 0));
		textField_6.setOpaque(false);
		GridBagConstraints gbc_textField_6 = new GridBagConstraints();
		gbc_textField_6.insets = new Insets(0, 0, 5, 0);
		gbc_textField_6.fill = GridBagConstraints.HORIZONTAL;
		gbc_textField_6.gridx = 1;
		gbc_textField_6.gridy = 11;
		add(textField_6, gbc_textField_6);
		textField_6.setColumns(10);
		
		lblRoute = new JLabel(ResourceBundle.getBundle("spotGUI.personalProfileGUI.messages").getString("PersonalDataPanel.lblRoute.text")); //$NON-NLS-1$ //$NON-NLS-2$
		lblRoute.setFont(font);
		GridBagConstraints gbc_lblRoute = new GridBagConstraints();
		gbc_lblRoute.anchor = GridBagConstraints.NORTHEAST;
		gbc_lblRoute.insets = new Insets(0, 0, 5, 5);
		gbc_lblRoute.gridx = 0;
		gbc_lblRoute.gridy = 12;
		add(lblRoute, gbc_lblRoute);
		
		textField_7 = new JTextField();
		textField_7.setDocument(new MaxLenghtTextDocument(35));
		textField_7.setEditable(false);
		textField_7.setBorder(new EmptyBorder(0, 0, 0, 0));
		textField_7.setOpaque(false);
		GridBagConstraints gbc_textField_7 = new GridBagConstraints();
		gbc_textField_7.insets = new Insets(0, 0, 5, 0);
		gbc_textField_7.fill = GridBagConstraints.HORIZONTAL;
		gbc_textField_7.gridx = 1;
		gbc_textField_7.gridy = 12;
		add(textField_7, gbc_textField_7);
		textField_7.setColumns(10);
		
		lblPhone = new JLabel(ResourceBundle.getBundle("spotGUI.personalProfileGUI.messages").getString("PersonalDataPanel.lblPhone.text")); //$NON-NLS-1$ //$NON-NLS-2$
		lblPhone.setFont(font);
		GridBagConstraints gbc_lblPhone = new GridBagConstraints();
		gbc_lblPhone.anchor = GridBagConstraints.NORTHEAST;
		gbc_lblPhone.insets = new Insets(0, 0, 5, 5);
		gbc_lblPhone.gridx = 0;
		gbc_lblPhone.gridy = 14;
		add(lblPhone, gbc_lblPhone);
		
		textField_19 = new JTextField();
		textField_19.setDocument(new MaxLenghtTextDocument(35));
		textField_19.setEditable(false);
		textField_19.setBorder(new EmptyBorder(0, 0, 0, 0));
		textField_19.setOpaque(false);
		GridBagConstraints gbc_textField_19 = new GridBagConstraints();
		gbc_textField_19.insets = new Insets(0, 0, 5, 0);
		gbc_textField_19.fill = GridBagConstraints.HORIZONTAL;
		gbc_textField_19.gridx = 1;
		gbc_textField_19.gridy = 14;
		add(textField_19, gbc_textField_19);
		textField_19.setColumns(10);
		
		lblMobilePhone = new JLabel(ResourceBundle.getBundle("spotGUI.personalProfileGUI.messages").getString("PersonalDataPanel.lblMobilePhone.text")); //$NON-NLS-1$ //$NON-NLS-2$
		lblMobilePhone.setFont(font);
		GridBagConstraints gbc_lblMobilePhone = new GridBagConstraints();
		gbc_lblMobilePhone.anchor = GridBagConstraints.NORTHEAST;
		gbc_lblMobilePhone.insets = new Insets(0, 0, 5, 5);
		gbc_lblMobilePhone.gridx = 0;
		gbc_lblMobilePhone.gridy = 15;
		add(lblMobilePhone, gbc_lblMobilePhone);
		
		textField_20 = new JTextField();
		textField_20.setDocument(new MaxLenghtTextDocument(35));
		textField_20.setEditable(false);
		textField_20.setBorder(new EmptyBorder(0, 0, 0, 0));
		textField_20.setOpaque(false);
		GridBagConstraints gbc_textField_20 = new GridBagConstraints();
		gbc_textField_20.insets = new Insets(0, 0, 5, 0);
		gbc_textField_20.fill = GridBagConstraints.HORIZONTAL;
		gbc_textField_20.gridx = 1;
		gbc_textField_20.gridy = 15;
		add(textField_20, gbc_textField_20);
		textField_20.setColumns(10);
		
		lblMySport = new JLabel(ResourceBundle.getBundle("spotGUI.personalProfileGUI.messages").getString("PersonalDataPanel.lblMySport.text")); //$NON-NLS-1$ //$NON-NLS-2$
		lblMySport.setFont(font);
		GridBagConstraints gbc_lblMySport = new GridBagConstraints();
		gbc_lblMySport.anchor = GridBagConstraints.NORTHEAST;
		gbc_lblMySport.insets = new Insets(0, 0, 5, 5);
		gbc_lblMySport.gridx = 0;
		gbc_lblMySport.gridy = 17;
		add(lblMySport, gbc_lblMySport);
		
		textField_8 = new JTextField();
		textField_8.setDocument(new MaxLenghtTextDocument(35));
		textField_8.setEditable(false);
		textField_8.setBorder(new EmptyBorder(0, 0, 0, 0));
		textField_8.setOpaque(false);
		GridBagConstraints gbc_textField_8 = new GridBagConstraints();
		gbc_textField_8.insets = new Insets(0, 0, 5, 0);
		gbc_textField_8.fill = GridBagConstraints.HORIZONTAL;
		gbc_textField_8.gridx = 1;
		gbc_textField_8.gridy = 17;
		add(textField_8, gbc_textField_8);
		textField_8.setColumns(10);
		
		lblMyTeam = new JLabel(ResourceBundle.getBundle("spotGUI.personalProfileGUI.messages").getString("PersonalDataPanel.lblMyTeam.text")); //$NON-NLS-1$ //$NON-NLS-2$
		lblMyTeam.setFont(font);
		GridBagConstraints gbc_lblMyTeam = new GridBagConstraints();
		gbc_lblMyTeam.anchor = GridBagConstraints.NORTHEAST;
		gbc_lblMyTeam.insets = new Insets(0, 0, 5, 5);
		gbc_lblMyTeam.gridx = 0;
		gbc_lblMyTeam.gridy = 18;
		add(lblMyTeam, gbc_lblMyTeam);
		
		textField_9 = new JTextField();
		textField_9.setDocument(new MaxLenghtTextDocument(35));
		textField_9.setEditable(false);
		textField_9.setBorder(new EmptyBorder(0, 0, 0, 0));
		textField_9.setOpaque(false);
		GridBagConstraints gbc_textField_9 = new GridBagConstraints();
		gbc_textField_9.insets = new Insets(0, 0, 5, 0);
		gbc_textField_9.fill = GridBagConstraints.HORIZONTAL;
		gbc_textField_9.gridx = 1;
		gbc_textField_9.gridy = 18;
		add(textField_9, gbc_textField_9);
		textField_9.setColumns(10);
		
		lblBestSport = new JLabel(ResourceBundle.getBundle("spotGUI.personalProfileGUI.messages").getString("PersonalDataPanel.lblBestSport.text")); //$NON-NLS-1$ //$NON-NLS-2$
		lblBestSport.setFont(font);
		GridBagConstraints gbc_lblBestSport = new GridBagConstraints();
		gbc_lblBestSport.anchor = GridBagConstraints.NORTHEAST;
		gbc_lblBestSport.insets = new Insets(0, 0, 5, 5);
		gbc_lblBestSport.gridx = 0;
		gbc_lblBestSport.gridy = 19;
		add(lblBestSport, gbc_lblBestSport);
		
		textField_10 = new JTextField();
		textField_10.setDocument(new MaxLenghtTextDocument(35));
		textField_10.setEditable(false);
		textField_10.setBorder(new EmptyBorder(0, 0, 0, 0));
		textField_10.setOpaque(false);
		GridBagConstraints gbc_textField_10 = new GridBagConstraints();
		gbc_textField_10.insets = new Insets(0, 0, 5, 0);
		gbc_textField_10.fill = GridBagConstraints.HORIZONTAL;
		gbc_textField_10.gridx = 1;
		gbc_textField_10.gridy = 19;
		add(textField_10, gbc_textField_10);
		textField_10.setColumns(10);
		
		lblBestTeam = new JLabel(ResourceBundle.getBundle("spotGUI.personalProfileGUI.messages").getString("PersonalDataPanel.lblBestTeam.text")); //$NON-NLS-1$ //$NON-NLS-2$
		lblBestTeam.setFont(font);
		GridBagConstraints gbc_lblBestTeam = new GridBagConstraints();
		gbc_lblBestTeam.anchor = GridBagConstraints.NORTHEAST;
		gbc_lblBestTeam.insets = new Insets(0, 0, 5, 5);
		gbc_lblBestTeam.gridx = 0;
		gbc_lblBestTeam.gridy = 20;
		add(lblBestTeam, gbc_lblBestTeam);
		
		textField_11 = new JTextField();
		textField_11.setDocument(new MaxLenghtTextDocument(35));
		textField_11.setEditable(false);
		textField_11.setBorder(new EmptyBorder(0, 0, 0, 0));
		textField_11.setOpaque(false);
		GridBagConstraints gbc_textField_11 = new GridBagConstraints();
		gbc_textField_11.insets = new Insets(0, 0, 5, 0);
		gbc_textField_11.fill = GridBagConstraints.HORIZONTAL;
		gbc_textField_11.gridx = 1;
		gbc_textField_11.gridy = 20;
		add(textField_11, gbc_textField_11);
		textField_11.setColumns(10);
		
		lblBestSportsman = new JLabel(ResourceBundle.getBundle("spotGUI.personalProfileGUI.messages").getString("PersonalDataPanel.lblBestSportsman.text")); //$NON-NLS-1$ //$NON-NLS-2$
		lblBestSportsman.setFont(font);
		GridBagConstraints gbc_lblBestSportsman = new GridBagConstraints();
		gbc_lblBestSportsman.anchor = GridBagConstraints.NORTHEAST;
		gbc_lblBestSportsman.insets = new Insets(0, 0, 5, 5);
		gbc_lblBestSportsman.gridx = 0;
		gbc_lblBestSportsman.gridy = 21;
		add(lblBestSportsman, gbc_lblBestSportsman);
		
		textField_12 = new JTextField();
		textField_12.setDocument(new MaxLenghtTextDocument(35));
		textField_12.setEditable(false);
		textField_12.setBorder(new EmptyBorder(0, 0, 0, 0));
		textField_12.setOpaque(false);
		GridBagConstraints gbc_textField_12 = new GridBagConstraints();
		gbc_textField_12.insets = new Insets(0, 0, 5, 0);
		gbc_textField_12.fill = GridBagConstraints.HORIZONTAL;
		gbc_textField_12.gridx = 1;
		gbc_textField_12.gridy = 21;
		add(textField_12, gbc_textField_12);
		textField_12.setColumns(10);
		
		lblBestMusicalGenre = new JLabel(ResourceBundle.getBundle("spotGUI.personalProfileGUI.messages").getString("PersonalDataPanel.lblBestMusicalGenre.text")); //$NON-NLS-1$ //$NON-NLS-2$
		lblBestMusicalGenre.setFont(font);
		GridBagConstraints gbc_lblBestMusicalGenre = new GridBagConstraints();
		gbc_lblBestMusicalGenre.anchor = GridBagConstraints.NORTHEAST;
		gbc_lblBestMusicalGenre.insets = new Insets(0, 0, 5, 5);
		gbc_lblBestMusicalGenre.gridx = 0;
		gbc_lblBestMusicalGenre.gridy = 23;
		add(lblBestMusicalGenre, gbc_lblBestMusicalGenre);
		
		textField_13 = new JTextField();
		textField_13.setDocument(new MaxLenghtTextDocument(35));
		textField_13.setEditable(false);
		textField_13.setBorder(new EmptyBorder(0, 0, 0, 0));
		textField_13.setOpaque(false);
		GridBagConstraints gbc_textField_13 = new GridBagConstraints();
		gbc_textField_13.insets = new Insets(0, 0, 5, 0);
		gbc_textField_13.fill = GridBagConstraints.HORIZONTAL;
		gbc_textField_13.gridx = 1;
		gbc_textField_13.gridy = 23;
		add(textField_13, gbc_textField_13);
		textField_13.setColumns(10);
		
		lblBestSinger = new JLabel(ResourceBundle.getBundle("spotGUI.personalProfileGUI.messages").getString("PersonalDataPanel.lblBestSinger.text")); //$NON-NLS-1$ //$NON-NLS-2$
		lblBestSinger.setFont(font);
		GridBagConstraints gbc_lblBestSinger = new GridBagConstraints();
		gbc_lblBestSinger.anchor = GridBagConstraints.NORTHEAST;
		gbc_lblBestSinger.insets = new Insets(0, 0, 5, 5);
		gbc_lblBestSinger.gridx = 0;
		gbc_lblBestSinger.gridy = 24;
		add(lblBestSinger, gbc_lblBestSinger);
		
		textField_14 = new JTextField();
		textField_14.setDocument(new MaxLenghtTextDocument(35));
		textField_14.setEditable(false);
		textField_14.setBorder(new EmptyBorder(0, 0, 0, 0));
		textField_14.setOpaque(false);
		GridBagConstraints gbc_textField_14 = new GridBagConstraints();
		gbc_textField_14.insets = new Insets(0, 0, 5, 0);
		gbc_textField_14.fill = GridBagConstraints.HORIZONTAL;
		gbc_textField_14.gridx = 1;
		gbc_textField_14.gridy = 24;
		add(textField_14, gbc_textField_14);
		textField_14.setColumns(10);
		
		lblBestSong = new JLabel(ResourceBundle.getBundle("spotGUI.personalProfileGUI.messages").getString("PersonalDataPanel.lblBestSong.text")); //$NON-NLS-1$ //$NON-NLS-2$
		lblBestSong.setFont(font);
		GridBagConstraints gbc_lblBestSong = new GridBagConstraints();
		gbc_lblBestSong.anchor = GridBagConstraints.NORTHEAST;
		gbc_lblBestSong.insets = new Insets(0, 0, 5, 5);
		gbc_lblBestSong.gridx = 0;
		gbc_lblBestSong.gridy = 25;
		add(lblBestSong, gbc_lblBestSong);
		
		textField_15 = new JTextField();
		textField_15.setDocument(new MaxLenghtTextDocument(35));
		textField_15.setEditable(false);
		textField_15.setBorder(new EmptyBorder(0, 0, 0, 0));
		textField_15.setOpaque(false);
		GridBagConstraints gbc_textField_15 = new GridBagConstraints();
		gbc_textField_15.insets = new Insets(0, 0, 5, 0);
		gbc_textField_15.fill = GridBagConstraints.HORIZONTAL;
		gbc_textField_15.gridx = 1;
		gbc_textField_15.gridy = 25;
		add(textField_15, gbc_textField_15);
		textField_15.setColumns(10);
		
		lblBestBook = new JLabel(ResourceBundle.getBundle("spotGUI.personalProfileGUI.messages").getString("PersonalDataPanel.lblBestBook.text")); //$NON-NLS-1$ //$NON-NLS-2$
		lblBestBook.setFont(font);
		GridBagConstraints gbc_lblBestBook = new GridBagConstraints();
		gbc_lblBestBook.anchor = GridBagConstraints.NORTHEAST;
		gbc_lblBestBook.insets = new Insets(0, 0, 5, 5);
		gbc_lblBestBook.gridx = 0;
		gbc_lblBestBook.gridy = 27;
		add(lblBestBook, gbc_lblBestBook);
		
		textField_16 = new JTextField();
		textField_16.setDocument(new MaxLenghtTextDocument(35));
		textField_16.setEditable(false);
		textField_16.setBorder(new EmptyBorder(0, 0, 0, 0));
		textField_16.setOpaque(false);
		GridBagConstraints gbc_textField_16 = new GridBagConstraints();
		gbc_textField_16.insets = new Insets(0, 0, 5, 0);
		gbc_textField_16.fill = GridBagConstraints.HORIZONTAL;
		gbc_textField_16.gridx = 1;
		gbc_textField_16.gridy = 27;
		add(textField_16, gbc_textField_16);
		textField_16.setColumns(10);
		
		lblBestFilm = new JLabel(ResourceBundle.getBundle("spotGUI.personalProfileGUI.messages").getString("PersonalDataPanel.lblBestFilm.text")); //$NON-NLS-1$ //$NON-NLS-2$
		lblBestFilm.setFont(font);
		GridBagConstraints gbc_lblBestFilm = new GridBagConstraints();
		gbc_lblBestFilm.anchor = GridBagConstraints.NORTHEAST;
		gbc_lblBestFilm.insets = new Insets(0, 0, 5, 5);
		gbc_lblBestFilm.gridx = 0;
		gbc_lblBestFilm.gridy = 28;
		add(lblBestFilm, gbc_lblBestFilm);
		
		textField_17 = new JTextField();
		textField_17.setDocument(new MaxLenghtTextDocument(35));
		textField_17.setEditable(false);
		textField_17.setBorder(new EmptyBorder(0, 0, 0, 0));
		textField_17.setOpaque(false);
		GridBagConstraints gbc_textField_17 = new GridBagConstraints();
		gbc_textField_17.insets = new Insets(0, 0, 5, 0);
		gbc_textField_17.fill = GridBagConstraints.HORIZONTAL;
		gbc_textField_17.gridx = 1;
		gbc_textField_17.gridy = 28;
		add(textField_17, gbc_textField_17);
		textField_17.setColumns(10);
		
		lblBestActor = new JLabel(ResourceBundle.getBundle("spotGUI.personalProfileGUI.messages").getString("PersonalDataPanel.lblBestActor.text")); //$NON-NLS-1$ //$NON-NLS-2$
		lblBestActor.setFont(font);
		GridBagConstraints gbc_lblBestActor = new GridBagConstraints();
		gbc_lblBestActor.insets = new Insets(0, 0, 0, 5);
		gbc_lblBestActor.anchor = GridBagConstraints.NORTHEAST;
		gbc_lblBestActor.gridx = 0;
		gbc_lblBestActor.gridy = 29;
		add(lblBestActor, gbc_lblBestActor);
		
		textField_18 = new JTextField();
		textField_18.setDocument(new MaxLenghtTextDocument(35));
		textField_18.setEditable(false);
		textField_18.setBorder(new EmptyBorder(0, 0, 0, 0));
		textField_18.setOpaque(false);
		GridBagConstraints gbc_textField_18 = new GridBagConstraints();
		gbc_textField_18.fill = GridBagConstraints.HORIZONTAL;
		gbc_textField_18.gridx = 1;
		gbc_textField_18.gridy = 29;
		add(textField_18, gbc_textField_18);
		textField_18.setColumns(10);

	}
	
	public void setEditable (boolean editable) {
		
		textArea.setEditable(editable);
		textField.setEditable(editable);
		remove(textField);
		add(dateChooser, gbc_textField);
		textField_1.setEditable(editable);
		textField_2.setEditable(editable);
		textField_3.setEditable(editable);
		textField_4.setEditable(editable);
		textField_5.setEditable(editable);
		textField_6.setEditable(editable);
		textField_7.setEditable(editable);
		textField_8.setEditable(editable);
		textField_9.setEditable(editable);
		textField_10.setEditable(editable);
		textField_11.setEditable(editable);
		textField_12.setEditable(editable);
		textField_13.setEditable(editable);
		textField_14.setEditable(editable);
		textField_15.setEditable(editable);
		textField_16.setEditable(editable);
		textField_17.setEditable(editable);
		textField_18.setEditable(editable);
		textField_19.setEditable(editable);
		textField_20.setEditable(editable);
	}
	
	public PersonalData createNewPersonalData () {
		
		Timestamp birthdate = null;
		if (dateChooser.getDate() != null)
			birthdate = new Timestamp(dateChooser.getDate().getTime());
		
		return new PersonalData(textArea.getText(), birthdate, textField_1.getText(), textField_2.getText(),
				textField_3.getText(), textField_4.getText(), textField_5.getText(), textField_6.getText(), textField_7.getText(),
				textField_19.getText(), textField_20.getText(), textField_8.getText(), textField_9.getText(), textField_10.getText(),
				textField_11.getText(), textField_12.getText(), textField_13.getText(), textField_14.getText(), textField_16.getText(),
				textField_17.getText(), textField_18.getText(), textField_15.getText());
	}
}
